/*     */ package com.chinapay.secss.util;
/*     */ 
/*     */ import com.enation.app.javashop.framework.context.ThreadContextHolder;
/*     */ import com.enation.app.javashop.framework.exception.ServiceException;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import org.aspectj.lang.ProceedingJoinPoint;
/*     */ import org.aspectj.lang.annotation.Around;
/*     */ import org.aspectj.lang.annotation.Aspect;
/*     */ import org.aspectj.lang.annotation.Pointcut;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Service;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ @Service("chinaPaymnet")
/*     */ @Aspect
/*     */ public class ChinaPayment
/*     */ {
/*     */   @Autowired
/*     */   private ChinaPayConfig chinaPayConfig;
/*     */   
/*     */   /*@Pointcut("execution( * com.enation.app.javashop.core.goods.service.GoodsManager.add*(..) )")
*//*     *//*   private void a() {}*/
/*     */
/*     *//*   @Pointcut("execution( * com.enation.app.javashop.core.member.service.MemberManager.login*(..) )")
*//*     *//*   private void b() {}
*//*     *//*
*//*     *//*   @Pointcut("execution( * com.enation.app.javashop.core.member.service.MemberManager.mobileLogin*(..) )")
*//*     *//*   private void b1() {}
*//*     *//*
*//*     *//*   @Around("a()")
*//*     *//*   public Object doa(ProceedingJoinPoint pjp) throws Throwable {
*//*  39 *//*     c();
*//*  40 *//*     return pjp.proceed();
*//*     *//*   }
*//*     *//*
*//*     *//*
*//*     *//*   @Around("b1()")
*//*     *//*   public Object dob1(ProceedingJoinPoint pjp) throws Throwable {
*//*  46 *//*     c();
*//*  47 *//*     return pjp.proceed();
*//*     *//*   }
*//*     *//*
*//*     *//*   @Around("b()")
*//*     *//*   public Object dob(ProceedingJoinPoint pjp) throws Throwable {
*//*  52 *//*     c();
*//*  53 *//*     return pjp.proceed();
*//*     *//*   }
*//*     *//*
*//*     *//*   private void c() {
*//*  57 *//*     HttpServletRequest req = ThreadContextHolder.getHttpRequest();
*//*     *//*
*//*  59 *//*     if (req != null) {
*//*     *//*
*//*  61 *//*       String domain = req.getServerName();
*//*  62 *//*       PaymentResultPaser.parse();
*//*     *//*     }
*//*     *//*   }*/
/*     */ 
/*     */ 
/*     */   
/*  78 */   private static Map<String, Integer> checkedMap = new HashMap<String, Integer>();
/*     */ 
/*     */ 
/*     */   
/*     */   public boolean valid(String domain) {
/*  83 */     Integer checked = checkedMap.get(domain);
/*     */     
/*  85 */     if (checked == null) {
/*  86 */       checked = Integer.valueOf(0);
/*     */     }
/*     */     
/*  89 */     if (checked.intValue() == 2) {
/*  90 */       return false;
/*     */     }
/*     */     
/*  93 */     if (checked.intValue() == 1) {
/*  94 */       return true;
/*     */     }
/*     */     
/*  97 */     if (checked.intValue() == 0) {
/*  98 */       PayUtil.load(this.chinaPayConfig.getLicense());
/*  99 */       if (PayUtil.verify(domain)) {
/* 100 */         checked = Integer.valueOf(1);
/* 101 */         checkedMap.put(domain, checked);
/* 102 */         return true;
/*     */       } 
/* 104 */       checked = Integer.valueOf(2);
/* 105 */       checkedMap.put(domain, checked);
/* 106 */       return false;
/*     */     } 
/*     */ 
/*     */     
/* 110 */     return false;
/*     */   }
/*     */ }


/* Location:              C:\Users\Administrator\Downloads\jd-gui-windows-1.6.6\jd-gui-windows-1.6.6\chinapay-secure-1.5.1.jar!\com\chinapay\secs\\util\ChinaPayment.class
 * Java compiler version: 5 (49.0)
 * JD-Core Version:       1.1.3
 */